package afternoon;

public class Try_Catch {
    public static void main(String[] args) {

        try {
            int[] arr = null;
            System.out.println(arr.length);
            int i = 1 / 0;
            int[] array = new int[1];
            System.out.println(array[1]);

        } catch (NullPointerException e) {
            e.printStackTrace();
            System.out.println("空指针异常.....");

        } catch (ArithmeticException e) {

            System.out.println("除零异常.....");

        } catch (ArrayIndexOutOfBoundsException e) {

            System.out.println("数组越界异常......");

        } catch (Exception e) {

            System.out.println("出现异常.....");
        }

    }
}
